package org.kth.dks.dks_node;

/**
 * <p>Title: DKS</p>
 * <p>Description: DKS Middleware</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: KTH-IMIT</p>
 * @author not attributable
 * @version 1.0
 */


public class InsertType {
  private final String value;

  public static final InsertType INSERT  = new InsertType("insert");
  public static final InsertType REMOVE = new InsertType("remove");


  public String toString() { return value; }

  /**
   * Converts the String into a InsertType
   * @param insertTypeString is a string, e.g. "insert"
   * @return InsertType is the right instance of insertTypeString
   */
  static public InsertType valueOf(String insertTypeString) {
    if (insertTypeString.equalsIgnoreCase(INSERT.toString()))
      return INSERT;
    else if (insertTypeString.equalsIgnoreCase(REMOVE.toString()))
      return REMOVE;
    return null;
  }

  private InsertType (String val) { value=val; }
}
